home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 422_02 / laptalk / laptalk.doc < prev    next >
Encoding:
Text File  |  1994-03-20  |  45.9 KB  |  1,054 lines

  1.     
  2.     
  3.     
  4.     
  5.     
  6.     
  7.     
  8.     
  9.     
  10.     
  11.     
  12.     
  13.     
  14.     
  15.     
  16.                                  L A P T A L K
  17.     
  18.                                        A
  19.                                       Tiny
  20.                                Telecommunications
  21.                                     Program
  22.                                       for
  23.                                 Laptop Computers
  24.     
  25.                                   Release: 1.1
  26.     
  27.                                Revised: 30-Aug-93
  28.     
  29.     
  30.     
  31.     
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     
  39.     
  40.     
  41.     
  42.     
  43.                        Copyright 1991-1994 Dave Dunfield
  44.                               All rights reserved.
  45.     LAPTALK Users Guide                                              Page: 1
  46.  
  47.  
  48.     1. INTRODUCTION
  49.     
  50.           I first conceived of LAPTALK when I did a great deal of  traveling
  51.        with a small 8088 dual-floppy (no hard disk) laptop computer. Being a
  52.        shareware author, I try to log into local BBS's wherever I travel, to
  53.        upload the latest versions of my software.
  54.     
  55.           Some of my archives are quite large, requiring up to 1/2  hour  to
  56.        transfer (at 2400 bps). Using the floppies  was  unacceptable,  since
  57.        the drives just sat  there  starting  and  stopping....  The  obvious
  58.        solution  was  to  define  a  RAMdisk,  allowing  smooth,  quiet  and
  59.        non-destructive operation.
  60.     
  61.           Then I ran into a small problem.... The  telecomm  packages  which
  62.        contained the features I used were all very large, typically  200-300
  63.        Kbytes in size. This not only used up a good portion of the 640K  ram
  64.        on my laptop (thereby reducing the size of my RAMdisk), but  it  took
  65.        lot of space on the 720K floppy drive,  and  took  FOREVER  to  load.
  66.        There just had to be a better solution...
  67.     
  68.           I decided to write my own very small "no frills" terminal program,
  69.        which would still have the features I needed, which were:
  70.     
  71.           1) Reasonable subset of ANSI (VT100) terminal emulation
  72.           2) Built in capture and upload of ASCII files.
  73.           3) Ability to link to external transfer protocols
  74.           4) Powerful "command" language to automate uploads etc.
  75.           5) A simple "host" capability for remote access.
  76.     
  77.           The results  of  my  effort  was  LAPTALK,  a  ".COM"  file  which
  78.        addresses the above requirements, and weighs in at just over 20K.
  79.     
  80.           The complete source code to LAPTALK is distributed with my MICRO-C
  81.        compiler as an example program. See the enclosed CATALOG file.
  82.     LAPTALK Users Guide                                              Page: 2
  83.  
  84.  
  85.     2. USING LAPTALK
  86.     
  87.           When you first run LAPTALK, it  will  attempt  to  open  the  file
  88.        LAPTALK.CFG in your current directory. If found,  it  will  read  its
  89.        configuration from it.  If  the  configuration  file  is  not  found,
  90.        LAPTALK will display a warning message, and assume various defaults.
  91.     
  92.           Once started, LAPTALK will present you with a  terminal  emulation
  93.        screen. The top 24 lines are the actual data  window,  and  the  25th
  94.        line is a status line. You may now type on the keyboard to send  data
  95.        to the serial port, and see any incoming data in the terminal window.
  96.     
  97.        2.1 Command Line Options
  98.     
  99.              The format of the LAPTALK command line is:
  100.     
  101.                       LAPTALK [-i c=file] [script command]
  102.     
  103.              The '-i' switch tells  LAPTALK  to  NOT  enter  an  interactive
  104.           session. This is most useful when used with a command line  script
  105.           file, so that control will  return  to  DOS  when  the  script  is
  106.           finished.
  107.     
  108.              The 'c=<file>' parameter allows  you  to  specify  a  different
  109.           configuration file which is to be  used  instead  of  the  default
  110.           "LAPTALK.CFG".
  111.     
  112.              If [script command] is given, LAPTALK will  execute  the  named
  113.           script and pass  it  any  additional  arguments  BEFORE  the  main
  114.           interactive mode is entered.
  115.     
  116.        2.2 LAPTALK Functions
  117.     
  118.              To access LAPTALK's functions, press CTRL-HOME or CTRL-END. You
  119.           will be presented with this menu:
  120.     
  121.                                 +--------------+
  122.                                 |Function menu |
  123.                                 |Download file |
  124.                                 |Upload file   |
  125.                                 |Kill capture  |
  126.                                 |Perform script|
  127.                                 |Hangup modem  |
  128.                                 |Clear screen  |
  129.                                 |Configuration |
  130.                                 |Shell to DOS  |
  131.                                 |Exit to DOS   |
  132.                                 +--------------+
  133.     
  134.              You may activate a function by moving  the  highlighted  cursor
  135.           bar to it (with the UP and DOWN arrow keys) and pressing ENTER. To
  136.           quickly move the cursor bar to a particular entry, type the  first
  137.           letter of the entry.
  138.     LAPTALK Users Guide                                              Page: 3
  139.  
  140.  
  141.        2.3 Function menu
  142.     
  143.              This function presents you with a list of "functions" that have
  144.           been configured. Each function  represents  a  "script"  (command)
  145.           file, complete with arguments, that will run when that function is
  146.           selected.
  147.     
  148.              This is a convienent way to set up automatic dialing lists etc.
  149.     
  150.        2.4 Download file
  151.     
  152.              This function will prompt with a menu of  available  protocols,
  153.           and then for the name of  the  file  to  be  transferred.  If  you
  154.           specify a filename which contains wildcard character ('*' or '?'),
  155.           LAPTALK will show you a list of matching files, and allow  you  to
  156.           pick one.
  157.     
  158.              Once the filename is selected, LAPTALK will invoke the selected
  159.           protocol, and attempt to download the file from the remote  system
  160.           to your PC.
  161.     
  162.        2.5 Upload file
  163.     
  164.              This function is similar to "Download file",  except  that  the
  165.           file is transferred from your PC to the remote system.
  166.     
  167.        2.6 Kill capture
  168.     
  169.              This function  is  used  following  a  download  using  "ASCII"
  170.           protocol, to stop LAPTALK from capturing the terminal  session  to
  171.           the file. When an ASCII download is in effect, you  will  see  the
  172.           string "cap" in the status line  at  the  bottom  of  the  screen.
  173.           Selecting this function will stop the  data  capture,  and  remove
  174.           that indication from the status line.
  175.     
  176.        2.7 Perform script
  177.     
  178.              This function prompts for  a  script  filename  and  arguments.
  179.           Unless you specify otherwise, the file is assumed to be located in
  180.           the LAPTALK  home  directory,  and  it  is  assumed  to  have  the
  181.           extension ".SCR". LAPTALK will process  the  file  as  a  "script"
  182.           program.
  183.     
  184.              This method of running a script program  is  useful  for  those
  185.           files which you do not use  frequently  enough  to  have  in  your
  186.           "function  menu".  It  is  also  useful  in  that  you  may  enter
  187.           parameters to the program when you specify its name.
  188.     
  189.              If the filename you supply contains wildcard character ('*'  or
  190.           '?'), LAPTALK will show you a list of the matching  script  files,
  191.           and allow you to select one.
  192.     LAPTALK Users Guide                                              Page: 4
  193.  
  194.  
  195.        2.8 Hangup modem
  196.     
  197.              This command drops the DTR and RTS signals to the modem  for  a
  198.           brief period of time, causing most modems to go offline  and  hang
  199.           up any calls which are in  progress.  See  you  modem  manual  for
  200.           information on how to set up your modem to do this.
  201.     
  202.        2.9 Clear screen
  203.     
  204.              This functions clears the TTY screen.
  205.     
  206.        2.10 Configuration
  207.     
  208.              This function invokes the LAPTALK configuration menu,  allowing
  209.           you to alter the various parameters  controlling  all  aspects  of
  210.           LAPTALK's operation.
  211.     
  212.              See the "configuration" section for more details.
  213.     
  214.        2.11 Shell to DOS
  215.     
  216.              This function invokes the DOS command processor (as defined  in
  217.           the environment variable COMSPEC),  to  allow  you  to  enter  and
  218.           execute DOS commands. LAPTALK  remains  active.  Use  the  command
  219.           "EXIT" to return to LAPTALK.
  220.     
  221.        2.12 Exit to DOS
  222.     
  223.              This function terminates LAPTALK, returning to the DOS  command
  224.           processor.
  225.     LAPTALK Users Guide                                              Page: 5
  226.  
  227.  
  228.     3. CONFIGURATION
  229.     
  230.           When you select 'Configuration' from LAPTALK's main function menu,
  231.        you will be presented with this sub-menu:
  232.     
  233.                             +---------------------+
  234.                             |General switches     |
  235.                             |General parameters   |
  236.                             |Serial port settings |
  237.                             |Transfer protocols   |
  238.                             |Function menu scripts|
  239.                             |Video attributes     |
  240.                             |Load configuration   |
  241.                             |Save configuration   |
  242.                             +---------------------+
  243.     
  244.        3.1 General switches
  245.     
  246.              This configuration sub-menu presents you with  a  selection  of
  247.           ON/OFF switches, which control the  way  LAPTALK  handles  certain
  248.           events. To toggle a particular switch between 'Y'es (ON) and  'N'o
  249.           (OFF), simply press the indicated number:
  250.     
  251.              1: Sound ALARM in messages
  252.     
  253.                 When set to 'Y'es (ON), this switch causes LAPTALK to  sound
  254.              a BEEP whenever an error  (or  informational)  message  box  is
  255.              presented.
  256.     
  257.              2: Echo data send in tty
  258.     
  259.                 When set to  'Y'es  (ON),  this  switch  causes  LAPTALK  to
  260.              display on the terminal  screen,  any  data  entered  from  the
  261.              keyboard, as well as sending it  to  the  remove  device.  This
  262.              option should be  set  ON  whenever  you  are  connected  to  a
  263.              computer which DOES NOT echo input data, and OFF  whenever  you
  264.              are using a system that DOES echo its input.
  265.     
  266.                 Incorrect setting of this option will cause the effect  that
  267.              either you cannot see what you are typing, OR you will get  two
  268.              characters displayed for every one that you type.
  269.     
  270.              3: Echo data sent in scripts
  271.     
  272.                 When set to  'Y'es  (ON),  this  switch  causes  LAPTALK  to
  273.              display on the terminal screen, any data that is transmitted by
  274.              scripts files (as well as send it to the remote device).
  275.     
  276.                 The correct setting of this switch will depend on the nature
  277.              of the script file, and the remote system.
  278.     LAPTALK Users Guide                                              Page: 6
  279.  
  280.  
  281.              4: Send LF on ASCII uploads
  282.     
  283.                 When set to 'Y'es (ON), this switch causes LAPTALK to output
  284.              both a CARRIAGE RETURN and a LINE FEED at the end of each  line
  285.              of text which is transmitted during an ASCII upload.  When  set
  286.              to 'N'o (OFF), only a CARRIAGE RETURN.
  287.     
  288.                 When uploading to a computer expecting keyboard input,  this
  289.              switch is usually set OFF, because you do not normally  include
  290.              LINE FEED on keyboard input. When uploading  to  a  printer  or
  291.              terminal, setting this switch ON will prevent the  output  from
  292.              continuously overwriting itself one line.
  293.     
  294.              5: Send space in NULL lines
  295.     
  296.                 When set to 'Y'es (ON), this switch causes LAPTALK to expand
  297.              any lines of ZERO LENGTH which  are  being  transmitted  during
  298.              ASCII uploads to contain a single space.
  299.     
  300.                 The text entry interface of many  online  systems  interpret
  301.              NULL lines as "end of entry". A null line in an  uploaded  file
  302.              will cause these system to stop accepting text (and usually get
  303.              very confused by the remainder of the uploaded  file).  Setting
  304.              this switch ON will prevent this from occuring.
  305.     
  306.              6: Drop DTR+RTS on exit
  307.     
  308.                 When set to  'Y'es  (ON),  this  switch  causes  LAPTALK  to
  309.              de-assert the DTR and RTS modem control signals of the PC  COMM
  310.              port whenever you select "Exit to DOS" from the main menu. This
  311.              will usually hangup a modem, or terminate you login session  on
  312.              a multitasking system. The exact  effect  will  depend  on  the
  313.              device to which you are connected.
  314.     
  315.                 When this  switch  set  OFF,  LAPTALK  leaves  DTR  and  RTS
  316.              asserted on the PC COMM port, insuring that device to which you
  317.              are connected is unaware that you have terminated the  program.
  318.              You may then re-enter LAPTALK and resume your communication  at
  319.              some later time.
  320.     
  321.        3.2 General parameters
  322.     
  323.              This configuration sub-menu presents you with  a  selection  of
  324.           parameters which control various aspects of LAPTALK's operation:
  325.     
  326.              Home directory
  327.     
  328.                 The directory name entered at this prompt determines the DOS
  329.              directory  where  LAPTALK  will  search   for   SCRIPT   FILES,
  330.              CONFIGURATION FILES, and FILE  TRANSFER  PROTOCOL  MODULES.  If
  331.              left blank, LAPTALK will search the current directory.
  332.     LAPTALK Users Guide                                              Page: 7
  333.  
  334.  
  335.              Tab spacing
  336.     
  337.                 This parameter defines the spacing of TAB STOPS in the  main
  338.              terminal screen. When a  TAB  character  is  received,  LAPTALK
  339.              advances te cursor to the next tab stop.
  340.     
  341.              Modem hangup delay
  342.     
  343.                 This parameter defines  the  number  of  seconds  for  which
  344.              LAPTALK will drop the DTR and  RTS  modem  control  signals  in
  345.              order to hang up the modem. LAPTALK will hang up the  modem  in
  346.              rsponse to your selection of the "Hnagup modem" option  of  the
  347.              main function menu, or the occurance of a "hangup" command in a
  348.              script file.
  349.     
  350.              String TX character delay
  351.     
  352.                 This parameter defines the length of time which LAPTALK will
  353.              wait between characters in a string being  transmitted.  String
  354.              transmissions occur as a result of several SCRIPT commands,  as
  355.              well as the ANSI function keys in tty mode.
  356.     
  357.                 The length if time  indicated  by  each  unit  of  value  is
  358.              dependant on the CPU  speed  of  your  PC.  You  will  have  to
  359.              experiment to obtain appropriate values for your application.
  360.     
  361.              ASCII Upload char delay
  362.     
  363.                 This parameter defines the length of time which LAPTALK will
  364.              wait between characters transmitted during ASCII uploads.
  365.     
  366.                 The length if time  indicated  by  each  unit  of  value  is
  367.              dependant on the CPU  speed  of  your  PC.  You  will  have  to
  368.              experiment to obtain appropriate values for your application.
  369.     
  370.              ASCII Upload line delay
  371.     
  372.                 This parameter defines the length of time which LAPTALK will
  373.              wait between lines transmitted during ASCII uploads.
  374.     
  375.                 The length if time  indicated  by  each  unit  of  value  is
  376.              dependant on the CPU  speed  of  your  PC.  You  will  have  to
  377.              experiment to obtain appropriate values for your application.
  378.     LAPTALK Users Guide                                              Page: 8
  379.  
  380.  
  381.              ASCII Upload sync. char
  382.     
  383.                 This parameter defines an ASCII character  value  for  which
  384.              LAPTALK will wait, after sending a line during ASCII uploads. A
  385.              value of zero (0) is a special  case,  and  causes  LAPTALK  to
  386.              ignore the sync character, proceeding immediately (after  ASCII
  387.              Upload line delay) with tramsission of the next line.
  388.     
  389.                 LAPTALK will only match characters which are received  AFTER
  390.              the line has been transmitted. This prevents any occurances  of
  391.              the defined character which  are  imbedded  in  the  line  from
  392.              triggering the next transmission.
  393.     
  394.                 LAPTALK will always wait for the  minimum  time  defined  by
  395.              "ASCII  Upload  line  delay"   before   proceeding   with   the
  396.              transmission,  regardless  of  when  the  sync.  character   is
  397.              received. It will also wait for one interval of time defined by
  398.              "ASCII Upload char delay" before proceeding  with  transmission
  399.              if the sync. character is received after the "line  delay"  has
  400.              expired.
  401.     
  402.                 In the event that a communication error or some other  event
  403.              prevents LAPTALK from  seeing  the  sync.  character,  you  can
  404.              manually proceed to the next line by pressing the SPACE bar.
  405.     
  406.        3.3 Serial port settings
  407.     
  408.              This configuration sub-menu allows you to select the COMM port,
  409.           Baudrate, Parity, Number of Data bits, Number of  Stop  bits,  and
  410.           Enable/Disable XON/XOFF flow control.
  411.     
  412.        3.4 Transfer protocols
  413.     
  414.              This configuration sub-menu permits you to define up  to  eight
  415.           file transfer protocols,  which  can  be  invoked  from  the  main
  416.           function menu,
  417.     
  418.              For details on configuring the protocols, refer  to  the  "FILE
  419.           TRANSFER PROTOCOLS" section of this manual.
  420.     LAPTALK Users Guide                                              Page: 9
  421.  
  422.  
  423.        3.5 Function menu scripts
  424.     
  425.              This configuration sub-menu permits you to define up  to  eight
  426.           script files (complete with arguments) which may be  invoked  from
  427.           the "Function menu" selection  of  the  main  LAPTALK  menu.  This
  428.           provides "fast access" to your favorite scripts.
  429.     
  430.              Each entry has the following format:
  431.     
  432.                      [name;][script file name] [arguments]
  433.     
  434.              [name;] is the  name  that  will  appear  in  the  script  file
  435.           selection window. It is delimited from the filename by a semicolon
  436.           (';'). If no name is given,  LAPTALK  displays  the  name  of  the
  437.           script file.
  438.     
  439.              [script file name] is the full name of the script file which is
  440.           to run when this entry is  selected.  If  not  specified,  LAPTALK
  441.           assumes the extension ".SCR". Unless the name includes a directory
  442.           path, LAPTALK assumes that the file will be found in  the  LAPTALK
  443.           home directory.
  444.     
  445.              [arguments] are any command  line  arguments  which  should  be
  446.           passed to the script file.
  447.     
  448.              Here are a few example entries which implement a simple  "phone
  449.           list" using the "dial.scr" script supplied with LAPTALK:
  450.     
  451.                 BBS;dial 555-1234
  452.                 WORK;dial 555-5678
  453.                 JOHN;dial 555-9012
  454.     
  455.              NOTE: See 'PHONE.SCR' for another way to set up a phone list.
  456.     LAPTALK Users Guide                                              Page: 10
  457.  
  458.  
  459.        3.6 Video attributes
  460.     
  461.              This  configuration  option  allows  you  to  set   the   video
  462.           attributes (colors)  of  the  various  windows  and  screens  that
  463.           LAPTALK presents.
  464.     
  465.              The following entries may be selected:
  466.                 Main TTY screen
  467.                 Video attribute (1-7)   *
  468.                 Status line
  469.                 Error message box's
  470.                 String input fields     **
  471.                 Main menu's
  472.                 Sub-menu's
  473.     
  474.         * - Video attributes 1-7 are selected with the ANSI escape sequence
  475.             "ESC[#n", where '#' is the number from 1-7. If '#' is specified
  476.             as '0', the "Main TTY screen" attribute is restored.
  477.     
  478.         **- Also includes FILE SELECTION WINDOWS.
  479.     
  480.              When you select this option, you will  be  presented  with  the
  481.           "Main TTY screen" attributes. You may use the PgDn and  PgUp  keys
  482.           to cycle between the selections listed above.
  483.     
  484.              The Right and Left arrow keys may be used to cycle between  the
  485.           available FOREGROUND video options.
  486.     
  487.              The Up and Down arrow keys may be used  to  cycle  between  the
  488.           available BACKGROUND video options.
  489.     
  490.              Press ESCAPE when you have finished. NOTE: If you have  altered
  491.           the "Main TTY screen" or the "Status line" entries, the TTY screen
  492.           will be cleared to new attributes.
  493.     
  494.        3.7 Load configuration
  495.     
  496.              This option prompts you for a filename,  and  then  loads  that
  497.           file as a new LAPTALK configuration. The  LAPTALK  home  directory
  498.           and the extension ".CFG" are  assumed  if  not  specified  in  the
  499.           filename. Wildcard characters ('*' and '?') may be used, in  which
  500.           case you will be presented with a menu of the  matching  files  to
  501.           pick from.
  502.     
  503.        3.8 Save configuration
  504.     
  505.              This options prompts you for a filename,  and  then  saves  the
  506.           current LAPTALK configuration into that  file.  The  LAPTALK  home
  507.           directory and the extension ".CFG" are assumed if not specified in
  508.           the filename. Wildcard characters ('*' and '?') may  be  used,  in
  509.           which case you will be presented with a menu of matching files  to
  510.           pick from.
  511.     LAPTALK Users Guide                                              Page: 11
  512.  
  513.  
  514.     4. FILE TRANSFER PROTOCOLS
  515.     
  516.           LAPTALK allows up to 8 file  transfer  protocols  to  be  defined,
  517.        which are implemented as external programs. Only the  ASCII  transfer
  518.        protocol is implemented internally.
  519.     
  520.        4.1 Configuration
  521.     
  522.              You set up  the  file  transfer  protocols  via  the  "Transfer
  523.           Protocols" option under the configuration menu.  You  may  make  8
  524.           entries, one for each protocol.
  525.     
  526.              The format of the protocol definition entry is as follows:
  527.     
  528.                    [name;][executable file name] [arguments]
  529.     
  530.              [name;] is the name that  appears  in  the  protocol  selection
  531.           window, of the file upload/download  functions.  It  is  delimited
  532.           from the filename by a semicolon  (';').  If  no  name  is  given,
  533.           LAPTALK displays the name of the executable file.
  534.     
  535.              [executable file name] is the full name of the program which is
  536.           to run when the protocol is selected.  It  must  be  a  ".COM"  or
  537.           ".EXE" file (LAPTALK assumes ".COM" is no type is  given).  Unless
  538.           the name includes a directory path, LAPTALK assumes that the  file
  539.           will be found in the LAPTALK home directory.
  540.     
  541.              [arguments] are any command  line  arguments  which  should  be
  542.           passed to the program. The following "special  sequences"  may  be
  543.           used in the arguments field:
  544.     
  545.             \A          - Use ASCII transfer instead of COM/EXE file.
  546.             \B          - Insert BAUD rate ('110'-'38400').
  547.             \C          - Insert COMM port ('1'-'4').
  548.             \D<string>\ - Insert <string> for DOWNLOADS only.
  549.             \F          - Obtain and insert a filename.
  550.             \G          - Like '\F' but ignored for downloads.
  551.             \H          - Insert LAPTALK home directory.
  552.             \N          - Insert number of DATA BITS (5-8).
  553.             \P          - Insert PARITY (Odd, Even, Mark, Space or None).
  554.             \S          - Insert number of STOP BITS (1-2).
  555.             \U<string>\ - Insert <string> for UPLOADS only.
  556.             \W          - Wait for ENTER after transfer.
  557.             \X          - Like '\F' but passes wildcards through.
  558.             \Y          - Like '\X' but ignored for downloads.
  559.             \Z          - ZAP (save, clear and restore) screen.
  560.             \\          - Insert a single '\'.
  561.     LAPTALK Users Guide                                              Page: 12
  562.  
  563.  
  564.        4.2 The XMODEM module
  565.     
  566.              The  LAPTALK  package  includes  XMODEM.COM,  a  program  which
  567.           implements basic XMODEM  file  transfers.  It  has  the  following
  568.           command line syntax:
  569.     
  570.            XMODEM <filename> [-C -D -P R=size P=port F=value S=speed]
  571.     
  572.              The meanings of the command line options are:
  573.     
  574.                 -C      - Skip CRC negotiation & proceed with CHECKSUM
  575.                 -D      - Perform DOWNLOAD instead of UPLOAD
  576.                 -P      - Force pause ("Press any key") when finished
  577.                 R=size  - Specify record size
  578.                 P=port  - Specify COMM port (1, 2, 3 or 4)
  579.                 F=value - Fill unused bytes of last upload record
  580.                           with this value.
  581.                 S=speed - Communicate at this baud rate
  582.     
  583.              Here are some LAPTALK protocol entries for use with XMODEM.COM:
  584.     
  585.                         Xmodem \F s=\B\D -d\
  586.                         Xmodem/1K;xmodem \F s=\B r=1024\D -d\
  587.     
  588.        4.3 Examples
  589.     
  590.              The internal ASCII transfer can be activiated with  a  transfer
  591.           protocol entry such as:
  592.     
  593.                         ASCII \F\A
  594.     
  595.              Here are XMODEM, YMODEM and ZMODEM  transfer  protocol  entries
  596.           which make use of a popular shareware communications module called
  597.           DSZ:
  598.     
  599.                         XMODEM;DSZ port \C \Drx\\Usx\ \F\Z
  600.                         YMODEM;DSZ port \C \Drb\\Usb\ \F\Z
  601.                         ZMODEM;DSZ port \C \Drz\\Usz\ \G\Z
  602.     
  603.           DSZ is available from:
  604.     
  605.                               Omen Technology INC
  606.                                  P.O. Box 4681
  607.                             Portland, OR 97208-4681
  608.                                FAX: 503-621-3735
  609.     LAPTALK Users Guide                                              Page: 13
  610.  
  611.  
  612.     5. SCRIPT INTERPRETER
  613.     
  614.           LAPTALK includes a powerful "script" interpreter, which allows you
  615.        to set up automatic sequences of events to be performed as  a  single
  616.        operation.
  617.     
  618.           The script interpreter can be considered as a simple  "programming
  619.        language", complete with commands, expressions and variables.
  620.     
  621.        5.1 Insert Codes
  622.     
  623.              Any any point in a script  file,  you  can  use  any  of  these
  624.           "Insert Codes", to cause the script interpreter to insert a  ASCII
  625.           string representing some value  into  the  command  line  at  that
  626.           point:
  627.     
  628.             ^c      - Insert control code of 'c'. (Ie: '^C' = 0x03)
  629.             \b      - Insert a BACKSPACE character. (0x08)
  630.             \d      - Insert a DELETE character.    (0x7F)
  631.             \e      - Insert a ESCAPE character.    (0x1B)
  632.             \h      - Insert LAPTALK home directory.
  633.             \r      - Insert a RETURN character.    (0x0D)
  634.             \n      - Insert a NEWLINE sequence.    (0X0D, 0x0A)
  635.             \s      - Insert the MODEM SIGNALS as a decimal value,
  636.                       made up of these components (OR'd together):
  637.                         1   - CTS has changed state.
  638.                         2   - DSR has changed state.
  639.                         4   - Ringing has just ended.
  640.                         8   - CD has changed state.
  641.                         16  - CTS state (1 = asserted)
  642.                         32  - DSR state (1 = asserted)
  643.                         64  - RI  state (1 = asserted)
  644.                         128 - CD  state (1 = asserted)
  645.                     * You can test the individual signals by ANDing ('&')
  646.                       this value with a mask.
  647.             \#n     - Insert character with decimal value n.
  648.             \0-9    - Insert the corresponding argument (0-9) from the script
  649.                       command line. Argument 0 is the name of the script.
  650.             \A-Z    - Insert the contents of the corresponding variable.
  651.             \\      - Insert a single '\'.
  652.             \^      - Insert a single '^'.
  653.     LAPTALK Users Guide                                              Page: 14
  654.  
  655.  
  656.        5.2 Script File Commands
  657.     
  658.              Some of commands  described  in  this  section  accept  various
  659.           arguments which they use to perform their actions. Arguments shown
  660.           in angle braces ('<>') are REQUIRED.  Arguments  shown  in  square
  661.           braces ('[]') are OPTIONAL.
  662.     
  663.              The various arguments accepted by the script commands are:
  664.     
  665.             text        - The rest of the command line, which is treated as a
  666.                           text string.
  667.     
  668.             variable    - A script variable name ('A'-'Z'). Note that for
  669.                           commands which specifically require a variable name,
  670.                           you DO NOT include a preceeding '\' (otherwise the
  671.                           CONTENTS of the variable would be passed).
  672.     
  673.             script      - The name of a script file.
  674.     
  675.             arguments   - Any arguments to a script file.
  676.     
  677.             protocol    - A file transfer protocol name. This is the name
  678.                           defined under the "Transfer Protocols" option of
  679.                           the configuration menu, which appears in the
  680.                           protocol selection list for uploads and downloads.
  681.     
  682.             filename    - The name of a file to upload or download.
  683.     
  684.             value       - An expression resulting in a numeric value. This
  685.                           may consist of numbers (-32768 to 32767) and any
  686.                           of the following operators:
  687.                                 +   - Addition          -   - Subtraction
  688.                                 *   - Multiplication    /   - Division
  689.                                 %   - Modulus           &   - Bitwise AND
  690.                                 |   - Bitwise OR        ^   - EXCLUSIVE OR
  691.                                 <<  - Shift Left        >>  - Shift Right
  692.                                 ==  - Test for EQUALITY (0=False, 1=True)
  693.                                 !=  - Test for INEQUALITY
  694.                                 >   - Test for GREATER THAN
  695.                                 <   - Test for LESS THAN
  696.                                 >=  - Test for GREATER THAN or EQUAL
  697.                                 <=  - Test for LESS THAN or EQUAL
  698.                           When multiple operators are present, they are
  699.                           processed from LEFT to RIGHT, without precedence.
  700.                           Round brackets '()' may be used for force the
  701.                           grouping of operators into sub-expressions.
  702.     
  703.             string      - A text string enclosed within delimiters.
  704.                           It does not matter what characters are used for the
  705.                           delimiters, as long as they are identical, and do not
  706.                           occur within the string.
  707.     
  708.             command     - Any script file command
  709.     
  710.             label       - A line label. Any line can be labeled by placing a
  711.                           colon (':') at the beginning of the line, followed
  712.                           immediately by a label name.
  713.     LAPTALK Users Guide                                              Page: 15
  714.  
  715.  
  716.           5.2.1 abort <text>
  717.     
  718.                 Displays <text> as an error message, and then terminates all
  719.              scripts (including any which  called  the  one  containing  the
  720.              "abort" command).
  721.     
  722.           5.2.2 assign <variable> <text>
  723.     
  724.                 Places  <text>  into  the  indicated  variable  (A-Z).  Each
  725.              variable can hold up to 50 characters.
  726.     
  727.           5.2.3 call <script> [arguments]
  728.     
  729.                 Suspends processing of the current script file,  and  begins
  730.              executing the named one. The new script file will have its  own
  731.              environment (arguments, variables etc.) and will not affect the
  732.              environment of the  calling  script.  When  the  called  script
  733.              terminates, the original script will resume execution.
  734.     
  735.           5.2.4 chain <script> [arguments]
  736.     
  737.                 Terminates execution  of  the  current  script,  and  begins
  738.              executing the named one. This function is  similar  to  "call",
  739.              except that the original script will not resume  when  the  new
  740.              one terminates.
  741.     
  742.           5.2.5 clear
  743.     
  744.                 This command clears the main terminal screen.
  745.     
  746.           5.2.6 close
  747.     
  748.                 This command is used to  stop  capturing  data  to  a  file,
  749.              following an ASCII download.
  750.     
  751.           5.2.7 config [config filename]
  752.     
  753.                 Loads all LAPTALK options  and  parameters  from  the  named
  754.              configuration file.
  755.     
  756.           5.2.8 dos [text]
  757.     
  758.                 The remainer of the  command  line  is  passed  to  the  DOS
  759.              command processor to be executed as a system command.
  760.     
  761.           5.2.9 download <protocol> [filename]
  762.     
  763.                 This  command  will  download  the  named  file  using   the
  764.              specified protocol (From your protocol setup menu).
  765.     
  766.                 If <filename> is not supplied, you will be prompted for it.
  767.     LAPTALK Users Guide                                              Page: 16
  768.  
  769.  
  770.           5.2.10 echo <text>
  771.     
  772.                 The remainder of  the  command  line  is  displayed  on  the
  773.              console terminal screen,  without  a  following  line-feed  and
  774.              carriage-return. See also 'print'.
  775.     
  776.           5.2.11 error <text>
  777.     
  778.                 Similar to "abort", except that the message is displayed  in
  779.              a window, and you must press ENTER to remove it.
  780.     
  781.           5.2.12 equate <variable> <value>
  782.     
  783.                 Similar to  "assign",  except  that  the  remainder  of  the
  784.              command line is evaluated as  a  numeric  expression,  and  the
  785.              result is assigned to the variable as an ASCII number.
  786.     
  787.           5.2.13 exittodos
  788.     
  789.                 Causes the entire LAPTALK program to terminate.  Control  is
  790.              returned to the DOS prompt.
  791.     
  792.           5.2.14 flush [text]
  793.     
  794.                 Removes  all  previously  received  data  from  the  capture
  795.              buffer. If [text] is supplied, that text is then  written  into
  796.              the capture buffer.
  797.     
  798.           5.2.15 goto [+]<label>
  799.     
  800.                 Searches the script file  for  the  location  of  the  named
  801.              label, and proceeds to execute commands from there.
  802.     
  803.                 If '+' is specified, the search will begin  at  the  current
  804.              line, instead of the beginning of the file. In  large  scripts,
  805.              this will speed up forward references to labels.
  806.     
  807.           5.2.16 hangup
  808.     
  809.                 This command drops the DTR and RTS signals to the modem  for
  810.              a period of time in order to force it offline.
  811.     
  812.           5.2.17 if <string> : <command>
  813.     
  814.                 Executes the named command only if <string> can  be  located
  815.              in the capture buffer.
  816.     
  817.           5.2.18 ifnot <string> : <command>
  818.     
  819.                 Executes the named command  only  if  <string>  can  NOT  be
  820.              located in the capture buffer.
  821.     LAPTALK Users Guide                                              Page: 17
  822.  
  823.  
  824.           5.2.19 ifeq <string> <string> : command
  825.     
  826.                 Executes the named command only of the  two  <string>'s  are
  827.              identical.
  828.     
  829.           5.2.20 ifne <string> <string> : command
  830.     
  831.                 Executes the named command only if the  two  <string>'s  are
  832.              NOT identical.
  833.     
  834.           5.2.21 if# <value> : command
  835.     
  836.                 Executes the named command only if  the  numeric  result  of
  837.              evaluating <value> is not zero.
  838.     
  839.           5.2.22 input <variable> [text]
  840.     
  841.                 Issues a prompt containing [text], and then reads  a  string
  842.              from the console which is assigned to the named <variable>.
  843.     
  844.           5.2.23 invisible
  845.     
  846.                 Causes all data subsequently received from the  serial  port
  847.              to NOT be displayed on the terminal screen. See also "visible".
  848.     
  849.           5.2.24 menu <variable> <text>
  850.     
  851.                 Presents a menu, with each word from <text> as a  selection.
  852.              The <variable> is set to 0 if the first entry  is  selected,  1
  853.              for the second, 2 for the third, etc. If the menu is aborted by
  854.              pressing ESCAPE, the variable is set to -1.
  855.     
  856.           5.2.25 print [text]
  857.     
  858.                 The remainder of  the  command  line  is  displayed  on  the
  859.              console  terminal  screen,  followed   by   a   line-feed   and
  860.              carriage-return. See also 'echo'.
  861.     
  862.           5.2.26 read <variable> <text>
  863.     
  864.                 Similar to "input", except that the prompt  is  issued,  and
  865.              the string is read from the serial port.
  866.     
  867.           5.2.27 rem [text]
  868.     
  869.                 This command is used to insert remarks into the script file.
  870.              The remainder of the command line is simply ignored.
  871.     
  872.           5.2.28 scan <string> <time> [: command]
  873.     
  874.                 Waits for either the specified <string> to be received  from
  875.              the serial port, or until <time> seconds  have  elapsed.  If  a
  876.              command is given, it will be executed if  the  string  was  NOT
  877.              seen before the timer expired.
  878.     LAPTALK Users Guide                                              Page: 18
  879.  
  880.  
  881.           5.2.29 send <text>
  882.     
  883.                 The remainder of the command  line  is  transmitted  to  the
  884.              serial port.
  885.     
  886.           5.2.30 skip <value>
  887.     
  888.                 Skips ahead by the specified number of lines,  and  proceeds
  889.              to process the script file from  there.  In  other  words,  the
  890.              specified number of lines  following  the  one  containing  the
  891.              "skip" command will not be processed.
  892.     
  893.                 This is a convienent way to perform  multi-line  conditional
  894.              statements.
  895.     
  896.           5.2.31 stop
  897.     
  898.                 Terminates processing of the current script  file.  If  this
  899.              file was called by another script file, that file will resume.
  900.     
  901.           5.2.32 terminal
  902.     
  903.                 This command invokes the ANSI  terminal,  which  will  allow
  904.              interactive communication with the remote port  until  CTRL-END
  905.              if entered, following which the script file will resume.
  906.     
  907.           5.2.33 upload <protocol> [filename]
  908.     
  909.                 This command will upload the named file using the  specified
  910.              protocol (From your protocol setup menu).
  911.     
  912.                 If <filename> is not supplied, you will be prompted for it.
  913.     
  914.           5.2.34 visible
  915.     
  916.                 Causes all data subsequently received from the  serial  port
  917.              to be displayed on the terminal screen. See also "invisible".
  918.     
  919.           5.2.35 wait <time>
  920.     
  921.                 Waits until no data has been received from the  serial  port
  922.              for the indicated number of seconds.
  923.     LAPTALK Users Guide                                              Page: 19
  924.  
  925.  
  926.        5.3 Fast Access Scripts
  927.     
  928.              You may set up a "Function menu", with up to  8  "fast  access"
  929.           scripts (complete with arguments) that can be invoked from  a  pop
  930.           up menu. This is done with  the  "Function  Menu  Scripts"  option
  931.           under the "Configuration" menu.
  932.     
  933.              The format of each function menu entry is:
  934.     
  935.                      [name;][script file name] [arguments]
  936.     
  937.              [name;] is the name that appears in the script  file  selection
  938.           window of the "Function menu" function. It is delimited  from  the
  939.           script file name by a semicolon (';').
  940.     
  941.              [script file name] is the full name of the script file which is
  942.           to be processed.  Unless  the  name  includes  a  directory  path,
  943.           LAPTALK assumes that the file will be found in  the  LAPTALK  home
  944.           directory. If not explicitly given, LAPTALK assumes the  extension
  945.           ".SCR".
  946.     
  947.              [arguments] are any command  line  arguments  which  should  be
  948.           passed to the script.
  949.     LAPTALK Users Guide                                              Page: 20
  950.  
  951.  
  952.     6. TERMINAL CONTROL CODES
  953.     
  954.           LAPTALK recognizes the  following  subset  of  the  ANSI  terminal
  955.        control codes:
  956.     
  957.             ^G          - Sound ALARM
  958.             ^H          - Backspace
  959.             ^I          - Horizontal TAB
  960.             ^J          - Line feed
  961.             ^M          - Carriage return
  962.             <ESC>[H     - Home cursor
  963.             <ESC>[f     - Alternate home cursor
  964.             <ESC>[#;#H  - Position cursor to Y,X
  965.             <ESC>[#;#f  - Alternate position cursor
  966.             <ESC>[J     - Clear to end of screen
  967.             <ESC>[0J    - Alternate clear to end of screen
  968.             <ESC>[2J    - Clear entire screen
  969.             <ESC>[K     - Clear to end of line
  970.             <ESC>[0K    - Alternate clear to end of line
  971.             <ESC>[2K    - Clear entire line
  972.             <ESC>[#m    - Select video attributes (1-7 or 0=Normal)
  973.     
  974.         The following special codes are transmitted for keys:
  975.     
  976.             <ESC>[A     - Up arrow
  977.             <ESC>[B     - Down arrow
  978.             <ESC>[C     - Right arrow
  979.             <ESC>[D     - Left arrow
  980.             <ESC>OP     - PgUp
  981.             <ESC>OS     - PgDn
  982.             <ESC>OP     - Home
  983.             <ESC>OQ     - End
  984.             <ESC>OM     - Keypad '+'
  985.             <ESC>Om     - Keypad '-'
  986.             <ESC>Op     - Insert
  987.             <ESC>Oq     - F1
  988.             <ESC>Or     - F2
  989.             <ESC>Os     - F3
  990.             <ESC>Ot     - F4
  991.             <ESC>Ou     - F5
  992.             <ESC>Ov     - F6
  993.             <ESC>Ow     - F7
  994.             <ESC>Ox     - F8
  995.             <ESC>Oy     - F9
  996.             <ESC>Oz     - F10
  997.             ^H          - Backspace
  998.             ^I          - TAB
  999.             ^M          - ENTER
  1000.             Hex: 7F     - Delete
  1001.  
  1002.  
  1003.  
  1004.                               LAPTALK Users Guide
  1005.  
  1006.                                TABLE OF CONTENTS
  1007.  
  1008.  
  1009.                                                                          Page
  1010.  
  1011.      1. INTRODUCTION                                                        1
  1012.  
  1013.  
  1014.      2. USING LAPTALK                                                       2
  1015.  
  1016.         2.1 Command Line Options                                            2
  1017.         2.2 LAPTALK Functions                                               2
  1018.         2.3 Function menu                                                   3
  1019.         2.4 Download file                                                   3
  1020.         2.5 Upload file                                                     3
  1021.         2.6 Kill capture                                                    3
  1022.         2.7 Perform script                                                  3
  1023.         2.8 Hangup modem                                                    4
  1024.         2.9 Clear screen                                                    4
  1025.         2.10 Configuration                                                  4
  1026.         2.11 Shell to DOS                                                   4
  1027.         2.12 Exit to DOS                                                    4
  1028.  
  1029.      3. CONFIGURATION                                                       5
  1030.  
  1031.         3.1 General switches                                                5
  1032.         3.2 General parameters                                              6
  1033.         3.3 Serial port settings                                            8
  1034.         3.4 Transfer protocols                                              8
  1035.         3.5 Function menu scripts                                           9
  1036.         3.6 Video attributes                                               10
  1037.         3.7 Load configuration                                             10
  1038.         3.8 Save configuration                                             10
  1039.  
  1040.      4. FILE TRANSFER PROTOCOLS                                            11
  1041.  
  1042.         4.1 Configuration                                                  11
  1043.         4.2 The XMODEM module                                              12
  1044.         4.3 Examples                                                       12
  1045.  
  1046.      5. SCRIPT INTERPRETER                                                 13
  1047.  
  1048.         5.1 Insert Codes                                                   13
  1049.         5.2 Script File Commands                                           14
  1050.         5.3 Fast Access Scripts                                            19
  1051.  
  1052.      6. TERMINAL CONTROL CODES                                             20
  1053.  
  1054.